'use strict';

/**
 * Create a bound version of a function with a specified `this` context
 *
 * @param {Function} fn - The function to bind
 * @param {*} thisArg - The value to be passed as the `this` parameter
 * @returns {Function} A new function that will call the original function with the specified `this` context
 */

//axios.js中传递实参
//fn : Axios.prototype.request
//thisArg : context --- > Axios实例
export default function bind(fn, thisArg) {
  //运行axios就是运行wrap函数
  return function wrap() {
    //本质就是调用 Axios.prototype.request函数 , 并将this执行Axios实例
    return fn.apply(thisArg, arguments);
  };
}
